package com.ssm.hj.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.GroupClassificationSearch;
import com.ssm.hj.service.GroupClassificationService;
import com.ssm.hj.view.GroupClassificationView;
import com.ssm.pojo.GroupClassification;
import com.ssm.pojo.TExamination;
import com.ssm.pojo.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class GroupClassificationController {
    @Resource
    private GroupClassificationService groupClassificationService;

    @RequestMapping("/hj/queryGroupClassificationAll")
    public PageInfo<GroupClassificationView> queryGroupClassificationAll(@RequestBody Page<GroupClassificationSearch> page) throws Exception{
        return this.groupClassificationService.queryGroupClassificationAllService(page);
    }
    @RequestMapping("/hj/queryByFileNumber")
    public GroupClassificationView queryByFileNumber(@RequestBody Page<Integer> page) throws Exception{
        return this.groupClassificationService.queryByFileNumberService(page);
    }
    @RequestMapping("/hj/queryHealthManager")
    public List<User> queryHealthManager() throws Exception{
        return this.groupClassificationService.queryHealthManagerService();
    };
    @RequestMapping("/hj/addOrUpdateGroupClassification")
    public int addOrUpdateGroupClassification(@RequestBody GroupClassification groupClassification) throws Exception {
        return this.groupClassificationService.addOrUpdateGroupClassificationService(groupClassification);
    }
    @RequestMapping("/hj/queryTExaminationById")
    public List<TExamination> queryTExaminationById(int id) throws Exception {
        return this.groupClassificationService.queryTExaminationByIdService(id);
    }
}
